package com.globallogic.dmytro_zakharenko.university.lessons;

import java.util.ArrayList;
import java.util.Arrays;

public class Lecture {

	private double mLectureStartTime;
	private ArrayList<String> mLectureDays;
	final public double LECTUREDURATION = 1.5;
	
	/**
	 * set lecture start time 
	 * 
	 * @param lectureStartTime
	 */
	public void setLectureStartTime(double lectureStartTime) {
		this.mLectureStartTime = lectureStartTime;
	}
	
	/**
	 * get lecture start time 
	 * 
	 * @return mLectureStartTime
	 */
	public double getLectureStartTime() {
		return mLectureStartTime;
	}
	
	/**
	 * set schedule for the lecture 
	 * 
	 * @param lectureDates array of days in the week 
	 */
	public void setSchedule(ArrayList<String> lectureDates) {
		this.mLectureDays = lectureDates;
	}
	
	/**
	 * get schedule for the lecture 
	 * 
	 * @return lectureDates array of days in the week
	 */
	public ArrayList<String> getSchedule() {
		return mLectureDays;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Arrays.hashCode(mLectureDays.toArray(new String[0]));
		long temp;
		temp = Double.doubleToLongBits(mLectureStartTime);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (other == null)
			return false;
		if (getClass() != other.getClass())
			return false;
		Lecture otherA = (Lecture) other;
		if (!Arrays.equals(mLectureDays.toArray(new String[0]), otherA.mLectureDays.toArray(new String[0])))
			return false;
		if (mLectureStartTime != otherA.mLectureStartTime)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Lecture [mLectureStartTime=" + mLectureStartTime
				+ ", mLectureDays=" + Arrays.toString(mLectureDays.toArray(new String[0]))
				+ ", LECTUREDURATION=" + LECTUREDURATION + "]";
	}
}
